using System.Collections.Generic;
using System.Threading.Tasks;
using ThridGroup.ERP.DTO.OrderManagement;
using Volo.Abp.Application.Services;

namespace ThridGroup.ERP.Application.Contracts.OrderManagement
{
    /// <summary>
    /// 销售订单服务接口
    /// </summary>
    public interface ISalesOrderService : IApplicationService
    {
        /// <summary>
        /// 添加销售订单
        /// </summary>
        Task<int> AddSalesOrder(CreateUpdateSalesOrderDto input);

        /// <summary>
        /// 获取所有销售订单
        /// </summary>
        Task<List<SalesOrderDto>> GetSalesOrders();

        /// <summary>
        /// 获取符合条件的销售订单列表（支持所有字段）
        /// </summary>
        Task<List<SalesOrderDto>> GetSalesOrdersByCondition(
            string orderCode,
            string orderName,
            string customerCode,
            string customerName,
            string customerPONumber,
            string orderCategory,
            string orderType,
            string orderFollower,
            string salesperson,
            string qualityRequirement,
            string currency,
            string settlementMethod,
            string orderDateStart,
            string orderDateEnd,
            string deliveryDateStart,
            string deliveryDateEnd
        );

        /// <summary>
        /// 获取单个销售订单
        /// </summary>
        Task<SalesOrderDto> GetSalesOrder(int id);

        /// <summary>
        /// 更新销售订单
        /// </summary>
        Task<int> UpdateSalesOrder(int id, CreateUpdateSalesOrderDto input);

        /// <summary>
        /// 删除销售订单
        /// </summary>
        Task DeleteSalesOrder(int id);

        /// <summary>
        /// 检查销售订单编码是否存在
        /// </summary>
        Task<bool> IsOrderCodeExist(string orderCode, int? excludeId = null);
    }
} 